package com.chaopei.absinter;

/**
 * @Author Corday 天涯
 * @Date 2022/3/8 9:59
 */
public class MyRect extends  MyAbs{
    private  double width;
    private  double height;
    public  MyRect(){}
    public MyRect(double weight, String detail, double width, double height) {
        super(weight, detail);
        this.width = width;
        this.height = height;
    }

    @Override
    public double calcArea(double... rect) {
        return rect[0]*rect[1];
    }

    @Override
    public String getDetail() {
        return "矩形面积:"+calcArea(width,height);
    }
}
